package com.onetech.adrewards.free.dialogs;

import android.content.Context;
import android.text.Html;
import android.widget.TextView;

import com.google.analytics.tracking.android.Fields;
import com.google.analytics.tracking.android.MapBuilder;
import com.google.analytics.tracking.android.Tracker;
import com.onetech.adrewards.free.objects.NewsDTO;
import com.onetech.adrewards.free.R;
import com.zuzu.dialogs.BaseDialog;

public class NewsDetailDialog extends BaseDialog {
	private TextView newsContent=null;
	
	private Tracker mTracker;
	private Context mContext=null;
	public NewsDetailDialog(Context context,NewsDTO data){
		super(context, data.getTitle(),
				TYPE_NO_BUTTON, R.layout.dialog_news_detail_layout);
		mContext=context;
		newsContent=(TextView)findViewById(R.id.newsContent);
		newsContent.setText(Html.fromHtml(data.getContents()));
	}	
	@Override
    public void onStart() {
        super.onStart();
        try {
            mTracker.set(Fields.SCREEN_NAME, mContext.getString(R.string.NewsDetailDialog));            
            mTracker.send(MapBuilder.createAppView().build());            
		} catch (Exception e) {
		}
    }	
}
